<template>
  <div>
    <el-pagination
      class="pagination"
      background
      layout="total, sizes, prev, pager, next"
      :total="total"
      @current-change="handleClickPage"
      @size-change="handleSizeChange"
    />
  </div>
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    total: {
      type: Number,
      default: 0
    }
  },
  methods: {
    handleClickPage(page) {
      this.$emit('click-page', page)
    },
    handleSizeChange(pageSize) {
      this.$emit('change-pagesize', pageSize)
    }
  }
}
</script>

<style scoped>
  .pagination {
    float: right;
    margin-top: 10px;
  }
</style>
